<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title></title>
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <meta name="description" content="">
    <meta name="author" content="binux">
    <script type="text/javascript" src="resource/vue.min.js"></script>
    <script type="text/javascript" src="resource/vue-resource.min.js"></script>
    <script type="text/javascript" src="resource/vue-router.min.js"></script>
    <script src="resource/webtorrent.min.js"></script>
    <link rel="stylesheet" href="resource/base.min.css">
    <script src="resource/CommentCoreLibrary.min.js"></script>
    <script src="resource/ABPlayer.min.js"></script>
    <script src = "resource/wilddog.js" ></script>

    <style>
      body {
        position: relative;
      }

      #app {
        padding-bottom: 40px;
      }

      span.size {
        float: right;
      }

      footer {
        position: absolute;
        height: 30px;
        width: 100%;
        bottom: 0;
        margin: 10px 0;
      }
      .text-center {
        text-align: center;
      }
    </style>
  </head>

  <body>

    <div id='app'>
      <h1><a v-link="{ path: '/' }">{{ glob }}</a></h1>
      <hr>
      <router-view></router-view>
    </div>

    <footer>
      <div class="container">
        <p class="text-center">a <a href="https://github.com/binux/" target="_blank">Binux</a>'s project.</p>
      </div>
    </footer>


    <script type="x/template" id="filelist-template">
      <ul>
        <li v-for="file in files | orderBy 'name'">
          <a v-link="{ name: 'video', params: { infohash: file.infoHash } }">{{ file.name }}</a>
          <span class="size">{{ file.length | smart-file-size }}</span>
        </li>
      </ul>
    </script>

    <script type="x/template" id="video-template">
      <p v-show="torrent===null">
        infohash: {{ $route.params.infohash }}
        grabing meta...
      </p>
      <div v-show="torrent">
        <h2>{{ torrent.files[0].name }}</h2>
        <dl>
          <dt>infoHash</dt>
          <dd><a href="{{ torrent.magnetURI }}">{{ torrent.infoHash }}</a></dd>

          <dt>downloaded</dt>
          <dd>{{ torrent.downloaded | smart-file-size }}@{{ downloadSpeed | smart-file-size }}/s FROM {{ torrent.numPeers }}conn ({{ (torrent.progress * 100).toFixed(1) }}%)</dd>
          <dd v-show="download_link"><a id="save-link" href="{{ download_link }}" download="{{ torrent.files[0].name }}">save</a></dd>

          <dt>timeRemaining</dt>
          <dd>{{ (timeRemaining / 1000).toFixed(0) }}s</dd>

          <dt>uploaded</dt>
          <dd>{{ torrent.uploaded | smart-file-size }}@{{ uploadSpeed | smart-file-size }}/s</dd>
        </dl>
        <div id=video-view></div>
      </div>
    </script>

    <script src="index.js"></script>
  </body>
</html>
<!-- vim: set et sw=2 ts=2 sts=2 ff=unix fenc=utf8: -->

